﻿
//	------------------------------------------------------------------------------
//                                       _                          
//              _ __ ___   ___ _ __ ___ | |__  _ __ __ _ _ __   ___ 
//             | '_ ` _ \ / _ \ '_ ` _ \| '_ \| '__/ _` | '_ \ / _ \
//             | | | | | |  __/ | | | | | |_) | | | (_| | | | |  __/
//             |_| |_| |_|\___|_| |_| |_|_.__/|_|  \__,_|_| |_|\___|
//                                                     
//	------------------------------------------------------------------------------

#region - License -
//
//	------------------------------------------------------------------------------                                                   
//	         Copyright (c) 2010 Peter Vyvey (peter.vyvey@chiliware.be)
//	------------------------------------------------------------------------------
//
//
//	This file is part of CHILIWARE MEMBRANE.
//
//	CHILIWARE MEMBRANE is free software: you can redistribute it and/or modify
//	it under the terms of the GNU Lesser General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	CHILIWARE MEMBRANE is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU Lesser General Public License for more details.
//
//	You should have received a copy of the GNU Lesser General Public License
//	along with CHILIWARE MEMBRANE.  If not, see <http://www.gnu.org/licenses/>.
//
//
#endregion

#region - Changes -
//
//	peter.vyvey@chiliware.be		2010-08-22		Created
//
#endregion

#region - Using -

using System;

#endregion

namespace Chiliware.Membrane.Model
{
	#region - IUserProfileService -

	/// <summary>
	/// Interface defining the user profile storage and retrieval API.
	/// </summary>
	public interface IUserProfileService
		: IDisposable
	{
		/// <summary>
		/// Stores a data object to the default storage level.
		/// </summary>
		/// <typeparam name="T">The type of the data object.</typeparam>
		/// <param name="sessionRegistryID">The registered session ID.</param>
		/// <param name="key">The key for the data object.</param>
		/// <param name="data">The data object.</param>
		void Store<T>(long sessionRegistryID, string key, T data);

		/// <summary>
		/// Stores a data object to the given storage level.
		/// </summary>
		/// <typeparam name="T">The type of the data object.</typeparam>
		/// <param name="sessionRegistryID">The registered session ID.</param>
		/// <param name="storageLevel">The storage level.</param>
		/// <param name="key">The key for the data object.</param>
		/// <param name="data">The data object.</param>
		void Store<T>(long sessionRegistryID, UserProfileStorageLevelType storageLevel, string key, T data);

		/// <summary>
		/// Retrieves the data object with the given key from the default storage level.
		/// </summary>
		/// <typeparam name="T">The type of the data object.</typeparam>
		/// <param name="sessionRegistryID">The registered session ID.</param>
		/// <param name="key">The key for the data object.</param>
		/// <returns>The data object of type T.</returns>
		T Retrieve<T>(long sessionRegistryID, string key);

		/// <summary>
		/// Retrieves the data object with the given key from the given storage level.
		/// </summary>
		/// <typeparam name="T">The type of the data object.</typeparam>
		/// <param name="sessionRegistryID">The registered session ID.</param>
		/// <param name="storageLevel">The storage level.</param>
		/// <param name="key">The key for the data object.</param>
		/// <returns>The data object of type T.</returns>
		T Retrieve<T>(long sessionRegistryID, UserProfileStorageLevelType storageLevel, string key);
	}

	#endregion
}
